/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.uml_generator.manager;

import java.util.Collection;
import java.util.Set;

import com.genia.toolbox.basics.exception.technical.TechnicalIOException;
import com.genia.toolbox.uml_generator.model.AbstractClassModel;
import com.genia.toolbox.uml_generator.model.AssociationModel;
import com.genia.toolbox.uml_generator.model.AttributeModel;
import com.genia.toolbox.uml_generator.model.OperationModel;

/**
 * manager to handle associations.
 */
public interface AssociationManager
{

  /**
   * returns the internal attribute associated to an association.
   * 
   * @param association
   *          the association
   * @return the attribute associated to the association
   * @throws TechnicalIOException
   *           when an I/O error occurred
   */
  public abstract AttributeModel getInternalAttributeForAssociation(AssociationModel association)
      throws TechnicalIOException;



  /**
   * returns all methods related to the associations given in parameter.
   * 
   * @param associations
   *          the associations to work with
   * @return all methods related to the associations given in parameter
   * @throws TechnicalIOException
   *           when an error occurred
   */
  public Collection<OperationModel> getAccessorMethodForAssociations(Collection<AssociationModel> associations)
      throws TechnicalIOException;



  /**
   * returns wether this end of an association is the delegating one, or not.
   * 
   * @param association
   *          the association to inspect
   * @return <code>false</code> if this end of the association is the
   *         delegating one
   */
  public abstract boolean hasPriority(AssociationModel association);



  /**
   * return the {@link Set} of {@link AssociationModel} that are new (not in the
   * super class) to the {@link AbstractClassModel} given in parameter.
   * 
   * @param classModel
   *          the {@link AbstractClassModel} to inspect.
   * @return the {@link Set} of {@link AssociationModel} that are new to the
   *         {@link AbstractClassModel} given in parameter
   */
  public abstract Set<AssociationModel> newAssociations(AbstractClassModel classModel);



  /**
   * return the {@link Set} of {@link AssociationModel} that are new (not either
   * in the super class or the implemented interfaces) to the
   * {@link AbstractClassModel} given in parameter.
   * 
   * @param classModel
   *          the {@link AbstractClassModel} to inspect.
   * @return the {@link Set} of {@link AssociationModel} that are new to the
   *         {@link AbstractClassModel} given in parameter
   */
  public abstract Set<AssociationModel> newAssociationsForInterface(AbstractClassModel classModel);

}
